/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * assign3
 * Copyright (C)  Michael 2008 <mikey.morckos@gmail.com>
 * 
 * assign3 is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * assign3 is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _ENGINE_H_
#define _ENGINE_H_

#include "label.cc"
#include "pos.cc"
#include "img_wrapper.h"

#include <opencv/cv.h>
#include <opencv/highgui.h>

#include <glib.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <math.h>

using namespace std;

class Engine {
	
    public:
	    Engine();
		virtual ~Engine();
		
		void display_Image(const char*);
		
		/* CANNY */
		void get_Viewport(int, int, int*, int*, int*, int*);
		void apply_Gauss();
		void apply_Roberts_Detector();
		
		void apply_Threshold(int);
		void apply_Local_Maxima(int, int);
		void apply_Suppression(int, int);
		void apply_Suppression2(int, int, int, int);
		
		/* CCLA */
		void check_Neighbors(int, int);
		void apply_Canny(int, int);
		
		void apply_Canny_CV(int, int);
		
		void check_equivelance(int, int, int*, Pix_Pos*);
		void apply_CCLA();
		
		inline string itos(int i) {
			 stringstream s;
		     s << i;
		     return s.str();
	    }

    private:
	    const char *file_name, *result_img;
		const char *name1, *name2, *name3;
		
		IplImage *img1, *img2, *img3;
		MY_Image img_data;
		
		ofstream output_file;

		int img_height, img_width;
};

#endif // _ENGINE_H_

